package com.mobile.tools;

import java.util.List;

public class PageBean<T> {
	/**
	 * 初始化分页参数
	 * Currentpage     当前的页数
	 * PrePage         上一页的页数
	 * NextPage		   下一页的页数
	 * list            取出来的数据集合
	 * PageSize        一页最大行数
	 * TotalPage       总共的页数
	 * TotalSize       总共取出数据的条数
	 * sql             sql语句
	 */
	private int currentPage=1;
	private int prePage=0;
	private int nextPage=0;
	private List<T> list;
	private int pageSize=0;
	private int totalPage=0;
	private int totalSize=0;
	private String sql;
	
		
	public void setCurrentPate(int currentPage) {
		if(currentPage<1)
			{
				currentPage = 1;
			}
		if(currentPage>totalPage)
			{
				currentPage=totalPage;
			}
		
		this.currentPage = currentPage;
	}


	public int getCurrentPage() {
		return currentPage;
	}

	public List<T> getList() {
		return list;
	}


	public void setList(List<T> list) {
		this.list = list;
	}


	public int getNextPage() {
		return nextPage=this.currentPage+1;
	}


	public void setNextPage(int nextPage) {
		this.nextPage = nextPage;
	}


	public int getPageSize() {
		return pageSize;
	}


	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}


	public int getPrePage() {
		return prePage=this.currentPage-1;
	}


	public void setPrePage(int prePage) {
		this.prePage = prePage;
	}


	public String getSql() {
		return sql;
	}


	public void setSql(String sql) {
		this.sql = sql;
	}


	public int getTotalPage() {
		return totalPage;
	}


	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}


	public int getTotalSize() {
		return totalSize;
	}


	public void setTotalSize(int totalSize) {
		this.totalSize = totalSize;
	}
	

	
}
